package com.example.pv.simpleplay;

import android.app.Service;
import android.content.Intent;
import android.media.MediaPlayer;
import android.os.IBinder;

/**
 * Created by pv on 2017/9/26.
 */

public class Music extends Service{

    private MediaPlayer player;
    @Override
    public IBinder onBind(Intent intent){
        return null;
    }
	
    public void onStart(Intent intent, int flags,int id){
        super.onStartCommand(intent, flags, id);
        player =MediaPlayer.create(this,R.raw.gequ);
        player.start();
    }

    public void onDestroy(){
        super.onDestroy();
        player.stop();
    }
}
